package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.dto.OrdersConfirmDTO;
import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.Orders;
import com.sky.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface OrderMapper {
    void submit(Orders orders);



    Page<OrderVO> page(OrdersPageQueryDTO ordersPageQueryDTO);


    void update(Orders orders);

    @Select("select * from orders where id=#{id}")
    Orders getOrdersById(Long id);


    void updateById(Orders orders);


    @Select("select * from orders where user_id=#{currentId}")
    List<Orders> getOrdersByUserId(Long currentId);

    @Select("select * from orders where id=#{id}")
    Orders getOrdersByIId(Integer id);

    @Select("select * from orders;")
    List<Orders> getAll();

    @Select("select * from orders where status=#{status}")
    List<Orders>  getDJD(Integer status);
}
